package com.mission.schedule.service;

import android.app.Service;
import android.appwidget.AppWidgetManager;
import android.content.Intent;
import android.os.Bundle;
import android.os.IBinder;
import android.text.TextUtils;
import android.util.Log;

import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request.Method;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;
import com.mission.schedule.activity.NewFriendsActivity;
import com.mission.schedule.applcation.App;
import com.mission.schedule.bean.CalenderNoteBean;
import com.mission.schedule.bean.CalenderUrlBean;
import com.mission.schedule.bean.DownLoadBackBean;
import com.mission.schedule.bean.DownLoadBean;
import com.mission.schedule.bean.DownNewSixTaskBean;
import com.mission.schedule.bean.DownWebCalenderNoteBean;
import com.mission.schedule.bean.ScheduBean;
import com.mission.schedule.bean.WBA_FindFunctionMy;
import com.mission.schedule.clock.QueryAlarmData;
import com.mission.schedule.constants.Const;
import com.mission.schedule.constants.ShareFile;
import com.mission.schedule.constants.URLConstants;
import com.mission.schedule.entity.ScheduleTable;
import com.mission.schedule.my160920.bean.FriendBackBean;
import com.mission.schedule.my160920.bean.FriendBean;
import com.mission.schedule.my160920.bean.FriendDeleteScheduleBean;
import com.mission.schedule.my160920.bean.FriendDownAllScheduleBean;
import com.mission.schedule.my160920.bean.FriendDownBackBean;
import com.mission.schedule.utils.DateUtil;
import com.mission.schedule.utils.SharedPrefUtil;
import com.mission.schedule.utils.StringUtils;
import com.mission.schedule.utils.XmlUtil;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 下载普通日程
 * Created by liwei on 2017/4/7.
 */

public class DownCalenderService extends Service {


    String path = "";
    App application = App.getDBcApplication();
    SharedPrefUtil sharedPrefUtil = null;
    int index;
    List<Map<String, String>> soundlist = new ArrayList<Map<String, String>>();
    String UserId = "";
    String schyear;
    String schtime;
    String repyear;
    String reptime;
    String dowmTime = "2017-12-20 00:00:00";
    int ic = 0;
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    private void saveFriend(DownNoteCalnderBean.ListBean bean) {
        boolean isSave = false;
        List<NewFriendsActivity.newFriendBean.PageBean.ItemsBean> itemsBeanList = App.getDBcApplication().getAllNewFriendData(UserId, false);
        for (NewFriendsActivity.newFriendBean.PageBean.ItemsBean itemsBean : itemsBeanList) {
            if (itemsBean.pname.equals(bean.name)) {
                isSave = true;
                break;
            }
        }
        if (!isSave) {
            NewFriendsActivity.newFriendBean.PageBean.ItemsBean itemsBean = new NewFriendsActivity.newFriendBean.PageBean.ItemsBean();
            itemsBean.pname = bean.name;
            itemsBean.uid = Integer.valueOf(UserId);
            itemsBean.puid = bean.tuId;
            itemsBean.pimgs = bean.titleImg;
            itemsBean.id = App.getDBcApplication().getNFMinId() - 1;
            itemsBean.createTime = DateUtil.nowTime();
            itemsBean.changeTime = DateUtil.nowTime();
            itemsBean.remark = "";
            itemsBean.remark1 = "";
            itemsBean.type = 0;
            App.getDBcApplication().saveNewFriendData(itemsBean, 1);
        }
    }

    boolean isOnRefresh = false;

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        if (intent != null) {
            isOnRefresh = intent.getBooleanExtra("isOnRefresh", false);
        }
        soundlist.clear();
        soundlist = XmlUtil.readBeforeBellXML(this);
        sharedPrefUtil = new SharedPrefUtil(getApplication(), ShareFile.USERFILE);
        UserId = sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.USERID, "");
        dowmTime = sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.DOWNTASKTIME, "2017-12-20 00:00:00");
        String date = DateUtil.formatDateTimeSs(new Date());
        int year1 = Integer.parseInt(date.substring(0, 4).toString()) - 1;
        if ("0".equals(sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.FIRSTLOGIN, "0"))) {
            schyear = String.valueOf(year1) + date.substring(4, 10).toString();
            schtime = date.substring(11, 19).toString();
            repyear = String.valueOf(year1) + date.substring(4, 10).toString();
            reptime = date.substring(11, 19).toString();
        } else {
            String schdate = sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.DOWNSCHTIME, "");
            if (!"".equals(schdate)) {
                try {
                    schyear = schdate.substring(0, 10);
                    schtime = schdate.substring(11);
                } catch (Exception e) {
                    schyear = DateUtil.formatDate(new Date());
                    schtime = DateUtil.formatDateTimeSs(new Date()).substring(11);
                }
            } else {
                schyear = String.valueOf(year1) + date.substring(4, 10).toString();
                schtime = date.substring(11, 19).toString();
            }
            String repdate = sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.DOWNREPTIME, "");
            if (!"".equals(repdate)) {
                try {
                    repyear = repdate.substring(0, 10);
                    reptime = repdate.substring(11);
                } catch (Exception e) {
                    repyear = DateUtil.formatDate(new Date());
                    reptime = DateUtil.formatDateTimeSs(new Date()).substring(11);
                }
            } else {
                repyear = String.valueOf(year1) + date.substring(4, 10).toString();
                reptime = date.substring(11, 19).toString();
            }
        }
        path = URLConstants.数据下载同步 + "?cUid=" + UserId + "&beforDownTime=" + schyear + "&time=" + schtime;
        if (sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.ISNEWYOUKE, "0").equals("-1") &&
                sharedPrefUtil.getString(getApplication(), ShareFile.USERFILE, ShareFile.FIRSTLOGIN, "0").equals("1")) {
            if ("0".equals(sharedPrefUtil.getString(this, ShareFile.USERFILE, ShareFile.FIRSTLOGIN, "0"))) {
                Intent frist_login_load = new Intent("frist_login_load");
                frist_login_load.putExtra("downcalender", "downcalender");
                sendBroadcast(frist_login_load);
            }

//            try {
//                List<Map<String, String>> allnotelist = application.queryAllSchData(-10, 0, 0);
//
//                if (allnotelist != null && allnotelist.size() > 0) {
//                    final JSONObject jsonObject = new JSONObject();
//                    JSONArray jsonArray = new JSONArray();
//                    for (Map<String, String> map : allnotelist) {
//                        NoteTitleDetailBean.TDelListBean bean = App.getDBcApplication().getOneNoteTitlesData(UserId, map.get(ScheduleTable.schSourceDesc), false);
//                        if (bean.titleId == null) {
//                            JSONObject jsonObject1 = new JSONObject();
//                            jsonObject1.put("uId", map.get(ScheduleTable.schcRecommendId));
//                            jsonObject1.put("titleId", map.get(ScheduleTable.schSourceDesc));
//                            jsonArray.put(jsonObject1);
//                        }
//                    }
//                    jsonObject.put("ly", jsonArray);
//
//                    if (jsonObject != null) {
//                        StringRequest request1 = new StringRequest(Method.POST, URLConstants.清单留言收藏方下行红点, new Response.Listener<String>() {
//                            @Override
//                            public void onResponse(String s) {
//                                if (!TextUtils.isEmpty(s)) {
//                                    try {
//                                        Gson gson = new Gson();
//                                        ReHod downLoadBean = gson.fromJson(s, ReHod.class);
//                                        if (downLoadBean.status == 0) {
//                                            List<ReHod.ListBean> listBeanList = downLoadBean.list;
//                                            if (listBeanList != null) {
//                                                MainActivity.instance.loadCount();
//                                                for (ReHod.ListBean bean : listBeanList) {
//                                                    Date d = DateUtil.parseDateTimeSs(App.getDBcApplication().getSchSourceDescSpare(bean.titleId));
//                                                    if (d == null) {
//                                                        d = DateUtil.parseDateTimeSs(DateUtil.formatDateTimeSs(new Date()));
//                                                    }
//                                                    if (DateUtil.parseDateTimeSs(bean.changeTime.replace('T', ' ')).after(d)) {
//                                                        App.getDBcApplication().updateRead1State(bean.titleId, 2);
//                                                        App.getDBcApplication().updateSchSourceDescSpare(bean.titleId, bean.changeTime.replace('T', ' '));
//                                                    }
//                                                }
//                                            }
//                                        }
//                                    } catch (JsonSyntaxException e) {
//                                        e.printStackTrace();
//                                    }
//                                }
//                            }
//
//
//                        }, new Response.ErrorListener() {
//                            @Override
//                            public void onErrorResponse(VolleyError volleyError) {
//
//                            }
//                        }) {
//                            @Override
//                            protected Map<String, String> getParams() throws AuthFailureError {
//                                Map<String, String> map = new HashMap<String, String>();
//                                map.put("data", jsonObject.toString());
//                                map.put("cuId", UserId);
//                                return map;
//                            }
//                        };
//                        request1.setTag("downNoteHongd");
//                        request1.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
//                        App.getHttpQueues().add(request1);
//                    }
//                }
//            } catch (Exception e) {
//                e.printStackTrace();
//            }
            RequestParams params1 = new RequestParams();
            params1.addBodyParameter("changTime", sharedPrefUtil.getString(ShareFile.tb_function_my, ""));
            new HttpUtils(5000).send(HttpMethod.POST, URLConstants.小程序表, params1, new RequestCallBack<String>() {
                @Override
                public void onSuccess(ResponseInfo<String> responseInfo) {
                    if (!TextUtils.isEmpty(responseInfo.result)) {
                        try {
                            Gson gson = new Gson();
                            WBA_FindFunctionMy bean = gson.fromJson(responseInfo.result, WBA_FindFunctionMy.class);
                            if (bean.status == 0) {
                                sharedPrefUtil.putString(getApplicationContext(), ShareFile.USERFILE, ShareFile.tb_function_my, bean.downTime.replace('T',' '));
                                List<WBA_FindFunctionMy.ListBean> list = bean.list;

                                if (list != null) {
                                    for (WBA_FindFunctionMy.ListBean listBean : list) {
                                        App.getDBcApplication().insert_tb_function_my(listBean);
                                    }
                                }
                            }
                        } catch (JsonSyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }

                @Override
                public void onFailure(HttpException e, String s) {
                    Log.e("TAG", s);
                }
            });

//            StringRequest request1 = new StringRequest(Method.POST, URLConstants.清单留言公开方公开发送url下行, new Response.Listener<String>() {
//                @Override
//                public void onResponse(String s) {
//                    if (!TextUtils.isEmpty(s)) {
//                        try {
//                            Gson gson = new Gson();
//                            DownNoteCalnderBean downLoadBean = gson.fromJson(s, DownNoteCalnderBean.class);
//                            if (downLoadBean.status == 0) {
//                                List<DownNoteCalnderBean.ListBean> listBeanList = downLoadBean.list;
//                                if (listBeanList != null) {
//                                    MainActivity.instance.loadCount();
//                                    for (DownNoteCalnderBean.ListBean bean : listBeanList) {
//                                        App.getDBcApplication().insertScheduleData(bean.content, DateUtil.formatDate(new Date()),
//                                                DateUtil.formatDateTimeHm(new Date()), 1,
//                                                0, 0, 1, 0,
//                                                0, 0, DateUtil.formatDateTimeSs(new Date()), bean.remark, 0,
//                                                bean.titleId, "", 0, "", DateUtil.formatDateTime(new Date()),
//                                                1, 0, 0, "完成任务", "g_88", bean.name, -1, 0, 0, "",
//                                                "", 0, 0, bean.tuId,0,"");
//                                        saveFriend(bean);
//                                    }
//                                }
//                                deleteNoteUrl();
//                            }
//                        } catch (JsonSyntaxException e) {
//                            e.printStackTrace();
//                        }
//                    }
//                }
//
//
//            }, new Response.ErrorListener() {
//                @Override
//                public void onErrorResponse(VolleyError volleyError) {}
//            }) {
//                @Override
//                protected Map<String, String> getParams() throws AuthFailureError {
//                    Map<String, String> map = new HashMap<String, String>();
//                    map.put("uId", UserId);
//                    return map;
//                }
//            };
//            request1.setTag("downNoteCalender");
//            request1.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
//            App.getHttpQueues().add(request1);
            StringRequest request3= new StringRequest(Method.POST, URLConstants.任务下行, new Response.Listener<String>() {
                @Override
                public void onResponse(String s) {
                    if (!TextUtils.isEmpty(s)) {
                        try {
                            Gson gson = new Gson();
                            DownNewSixTaskBean sixTaskBean = gson.fromJson(s, DownNewSixTaskBean.class);
                            List<DownNewSixTaskBean.ListOpdataBean> listOpdata = sixTaskBean.listOpdata;
                            if (listOpdata != null) {
                                for (DownNewSixTaskBean.ListOpdataBean bean : listOpdata) {
                                    App.getDBcApplication().deleteTitleIdTask(bean.titleId);
                                }
                            }
                            if (sixTaskBean.status == 0) {
                                sharedPrefUtil.putString(getApplicationContext(), ShareFile.USERFILE, ShareFile.DOWNTASKTIME, sixTaskBean.downTime.replace('T', ' '));
                                List<DownNewSixTaskBean.ListBean> listBeanList = sixTaskBean.list;

                                if (listBeanList != null) {
                                    for (DownNewSixTaskBean.ListBean bean: listBeanList) {
                                        if (bean != null) {
                                            if (bean.ctype == 0  && bean.content != null) {
                                                Map<String, String> map = App.getDBcApplication().isCalenderTitleId(StringUtils.getIsStringEqulesNull(bean.titleId));
                                                if (map != null && !map.get(ScheduleTable.schID).equals("")) {
                                                    int schUpdateState = 2;
                                                    if (map.get(ScheduleTable.schUpdateState).equals("1")) {
                                                        schUpdateState = 1;
                                                    }
                                                    App.getDBcApplication().insertTaskScheduleDataschID(map.get(ScheduleTable.ID),map.get(ScheduleTable.schID),
                                                            bean.content, bean.cdate, bean.ctime, Integer.valueOf(bean.cisAlarm), bean.cbeforTime,
                                                            bean.cdisplayAlarm, bean.cpostpone, bean.cimportant, bean.ccolorType, bean.pIsEnd,
                                                            DateUtil.nowTime(), "", bean.ptype + 3, bean.titleId, bean.styles + "", 0, "", "",
                                                            schUpdateState, 0, 0, bean.calarmSoundDesc, bean.calarmSound, bean.uname, 2, 0, 0, bean.remark5,
                                                            bean.titleImg, 0, 0, bean.uid, bean.cisEnd, bean.remark4, bean.remark2, bean.remark3);
                                                } else {
                                                    App.getDBcApplication().insertTaskScheduleData(
                                                            bean.content, bean.cdate, bean.ctime, Integer.valueOf(bean.cisAlarm), bean.cbeforTime,
                                                            bean.cdisplayAlarm, bean.cpostpone, bean.cimportant, bean.ccolorType, bean.pIsEnd,
                                                            DateUtil.nowTime(), "", bean.ptype + 3, bean.titleId, bean.styles + "", 0, "", "",
                                                            1, 0, 0, bean.calarmSoundDesc, bean.calarmSound, bean.uname, 1, 0, 0, bean.remark5,
                                                            bean.titleImg, 0, 0, bean.uid, bean.cisEnd, bean.remark4, bean.remark2, bean.remark3);
                                                }
                                            }
                                        }
                                    }
                                    updateFrendTaskIsDown();
                                }
                            }
                        } catch (JsonSyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }


            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {

                }
            }) {
                @Override
                protected Map<String, String> getParams() {
                    Map<String, String> map = new HashMap<String, String>();
                    map.put("uid", UserId);
                    map.put("cpId", UserId);
                    map.put("downTime", dowmTime.replace('T',' '));
                    map.put("titleId", "");
                    map.put("type", "4");
                    return map;
                }
            };
            request3.setTag("downSixTaskCalender");
            request3.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
            App.getHttpQueues().add(request3);
            StringRequest request4 = new StringRequest(Method.POST, URLConstants.下行临时表数据, new Response.Listener<String>() {
                @Override
                public void onResponse(String s) {
                    if (!TextUtils.isEmpty(s)) {
                        try {
                            Gson gson = new Gson();
                            CalenderUrlBean sixTaskBean = gson.fromJson(s, CalenderUrlBean.class);
                            if (sixTaskBean.status == 0) {
                                sharedPrefUtil.putString(getApplicationContext(), ShareFile.USERFILE, ShareFile.DOWNTASKTIME, sixTaskBean.downTime.replace('T', ' '));
                                List<CalenderUrlBean.ListBean> listBeanList = sixTaskBean.list;
                                if (listBeanList != null) {
                                    for (CalenderUrlBean.ListBean bean: listBeanList) {
                                        if (bean != null && bean.content != null) {
                                            Map<String, String> map = App.getDBcApplication().isCalenderTitleId(StringUtils.getIsStringEqulesNull(bean.titleId));
                                            if (map != null && !map.get(ScheduleTable.schID).equals("")) {
                                                int schUpdateState = 2;
                                                if (map.get(ScheduleTable.schUpdateState).equals("1")) {
                                                    schUpdateState = 1;
                                                }
                                                App.getDBcApplication().insertTaskScheduleDataschID(map.get(ScheduleTable.ID),map.get(ScheduleTable.schID), bean.content,
                                                        bean.cdate, bean.ctime, Integer.valueOf(bean.cisAlarm), bean.cbefortime,
                                                        bean.cdisplayAlarm, bean.cpostpone, bean.cimportant, 0, bean.cisEnd,
                                                        DateUtil.nowTime(), "", StringUtils.getIsStringEqulesNull(bean.remark1).equals("1") ? 4 : 5, bean.titleId, "0", 0, "", "",
                                                        schUpdateState, 0, 0, bean.calarmsoundDesc, bean.calarmsound, bean.pname, 2, 0, 0, bean.remark5,
                                                        bean.ptitleimg, 0, 0, bean.puid, 0, bean.remark4, bean.remark2, bean.remark3);
                                            } else {
                                                App.getDBcApplication().insertTaskScheduleData(bean.content,
                                                        bean.cdate, bean.ctime, Integer.valueOf(bean.cisAlarm), bean.cbefortime,
                                                        bean.cdisplayAlarm, bean.cpostpone, bean.cimportant, 0, bean.cisEnd,
                                                        DateUtil.nowTime(), "", StringUtils.getIsStringEqulesNull(bean.remark1).equals("1") ? 4 : 5, bean.titleId, "0", 0, "", "",
                                                        1, 0, 0, bean.calarmsoundDesc, bean.calarmsound, bean.pname, 1, 0, 0, bean.remark5,
                                                        bean.ptitleimg, 0, 0, bean.puid, 0,bean.remark4, bean.remark2, bean.remark3);
                                            }
                                        }
                                    }
                                    updateFrendTaskIsDown();
                                }
                            }
                        } catch (JsonSyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }


            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {

                }
            }) {
                @Override
                protected Map<String, String> getParams() {
                    Map<String, String> map = new HashMap<>();
                    map.put("uid", UserId);
                    map.put("changeTime", dowmTime.isEmpty() ? "2017-06-01 00:00:00" : dowmTime.replace('T',' '));
                    return map;
                }
            };
            request4.setTag("下行临时表数据");
            request4.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
            App.getHttpQueues().add(request4);

            StringRequest request2 = new StringRequest(Method.POST, URLConstants.下行临时日程清单, new Response.Listener<String>() {
                @Override
                public void onResponse(String s) {
                    if (!TextUtils.isEmpty(s)) {
                        try {
                            Gson gson = new Gson();
                            DownWebCalenderNoteBean webCalenderNoteBean = gson.fromJson(s, DownWebCalenderNoteBean.class);
                            if (webCalenderNoteBean.status == 0) {
                                List<DownWebCalenderNoteBean.ListBean> listBeanList = webCalenderNoteBean.list;
                                if (listBeanList != null) {
                                    String titles;
                                    String maxTitleId = DateUtil.nowTime2();
                                    if (listBeanList.size() > 0) {
                                        titles = listBeanList.get(0).titles;
                                        maxTitleId = listBeanList.get(0).titleId;
                                        App.getDBcApplication().insertScheduleData(titles,
                                                listBeanList.get(0).cdate, listBeanList.get(0).ctime, 1, 0,
                                                Integer.valueOf(listBeanList.get(0).remark3),
                                                Integer.valueOf(listBeanList.get(0).cpostpone), 0, 0, 0,
                                                listBeanList.get(0).createTime.replace('T',' '), "", 2, maxTitleId, "0", 0, "", "",
                                                1, 0, 0, "完成任务", "g_88", "", 0, 0, 0, "",
                                                StringUtils.getIsStringEqulesNull(listBeanList.get(0).cpath), 0, 0, -2,0,"","0","0");
                                    }
                                    for (DownWebCalenderNoteBean.ListBean listBean : listBeanList) {
                                        CalenderNoteBean.PageBean.ItemsBean bean = new CalenderNoteBean.PageBean.ItemsBean();
                                        bean.titleId = listBean.titleId;
                                        bean.uid = listBean.uid;
                                        bean.id = App.getDBcApplication().getCalenderMinId() - 1;
                                        bean.style = listBean.style;
                                        bean.changeTime = listBean.changeTime.replace('T',' ');
                                        bean.createTime = listBean.createTime.replace('T',' ');
                                        bean.ltype = listBean.ltype;
                                        bean.orderId = listBean.orderId;
                                        bean.endstate = 0;
                                        bean.remark = "";
                                        bean.contents = listBean.contents;
                                        bean.titles = listBean.titles;
                                        bean.imgPath = "";
                                        bean.imgUrl = "";
                                        bean.cpath = "";
                                        bean.curl = "";
                                        bean.sdesc = "";
                                        bean.nums = "";
                                        bean.localIds = DateUtil.nowTime2();
                                        bean.shareUrl = "";
                                        bean.remark1 = "";
                                        bean.remark2 = "";
                                        bean.remark3 = "";
                                        bean.remark4 = "";
                                        bean.remark5 = "";
                                        bean.remark6 = "";

                                        App.getDBcApplication().saveCalederNoteDetailData(bean);
                                        App.getDBcApplication().updateCalenderNoteDetailState(maxTitleId, bean.id, UserId, 1, true);
                                    }
                                }
                                deleteCalenderNoteUrl();

//                                Intent LocalSyni = new Intent(getApplicationContext(), LocalSynService.class);
//                                LocalSyni.setAction("LocalSynService");
//                                LocalSyni.putExtra("isMinLocal", true);
//                                LocalSyni.setPackage(getPackageName());
//                                startService(LocalSyni);
                            }
                        } catch (JsonSyntaxException e) {
                            e.printStackTrace();
                        }
                    }
                }


            }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {

                }
            }) {
                @Override
                protected Map<String, String> getParams() throws AuthFailureError {
                    Map<String, String> map = new HashMap<String, String>();
                    map.put("uid", UserId);
                    return map;
                }
            };
            request2.setTag("downWebCalenderNote");
            request2.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
            App.getHttpQueues().add(request2);

            if (sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.SJB, "").isEmpty()) {
                new HttpUtils(5000).send(HttpMethod.GET, URLConstants.世界杯和重要日, null, new RequestCallBack<String>() {
                    @Override
                    public void onSuccess(ResponseInfo<String> responseInfo) {
                        if (!TextUtils.isEmpty(responseInfo.result)) {
                            try {
                                Gson gson = new Gson();
                                findCalendarTj findCalendar = gson.fromJson(responseInfo.result, findCalendarTj.class);
                                if (findCalendar.status == 0) {
                                    List<findCalendarTj.ListBean> list = findCalendar.list;
                                    String name = "";
                                    String uid = "";
                                    String type = "";
                                    for (findCalendarTj.ListBean bean : list) {
                                        name += bean.name + ",";
                                        uid += bean.uid + ",";
                                        type += bean.type + ",";
                                    }
                                    if (!name.isEmpty()) {
                                        name = name.substring(0, name.length() - 1);
                                    }
                                    if (!uid.isEmpty()) {
                                        uid = uid.substring(0, uid.length() - 1);
                                    }
                                    if (!type.isEmpty()) {
                                        type = type.substring(0, type.length() - 1);
                                    }
                                    String sjb = "";
                                    if (!name.isEmpty() && !type.isEmpty() && !uid.isEmpty()) {
                                        sjb = "[[" + name + "],,[" + uid + "],,[" + type + "]]";
                                    }
                                    sharedPrefUtil.putString(getApplicationContext(), ShareFile.USERFILE, ShareFile.SJB, sjb);


                                    downqqq();
                                }
                            } catch (JsonSyntaxException e) {
                                e.printStackTrace();
                            }
                        }
                    }

                    @Override
                    public void onFailure(HttpException e, String s) {
                        Log.e("TAG", s);
                    }
                });
            }

//            DownFrend();
            //System.out.println("日程下载:" + path);
            StringRequest request = new StringRequest(Method.GET, path,
                    new Response.Listener<String>() {

                        @Override
                        public void onResponse(final String result) {
                            if (!TextUtils.isEmpty(result)) {
                                new Thread(new Runnable() {

                                    @Override
                                    public void run() {
                                        try {
                                            Gson gson = new Gson();
                                            DownLoadBackBean downLoadBean = gson.fromJson(result, DownLoadBackBean.class);

                                            List<ScheduBean> list = null;
                                            List<Integer> deleteID = null;
                                            if (downLoadBean.status == 0) {
                                                sharedPrefUtil.putString(
                                                        getApplication(),
                                                        ShareFile.USERFILE,
                                                        ShareFile.DOWNSCHTIME,
                                                        downLoadBean.message.replace("T", " "));
                                                List<DownLoadBean> beans = downLoadBean.maps;
                                                for (int k = 0; k < beans.size(); k++) {
                                                    deleteID = beans.get(k).delete;
                                                    list = beans.get(k).tbCalendar;
                                                }
                                                if (list != null && list.size() > 0) {
                                                    for (int i = 0; i < list.size(); i++) {
                                                        String ringcode = "";
                                                        String ringdesc = "";
                                                        for (int j = 0; j < soundlist.size(); j++) {
                                                            String str = list.get(i).cAlarmSoundDesc.replace(".ogg", "");
                                                            if (str.equals(soundlist.get(j).get("value"))) {
                                                                ringcode = soundlist.get(j).get("value");
                                                                ringdesc = soundlist.get(j).get("name");
                                                                break;
                                                            } else {
                                                                ringcode = "g_88";
                                                                ringdesc = "完成任务";
                                                            }
                                                        }
                                                        String str = list.get(i).cUpdateTime.toString().replace("T", " ");
                                                        int m = application.CheckCountSchData(list.get(i).cId);
                                                        int aid = list.get(i).attentionid;
                                                        int atype = list.get(i).aType;
                                                        if (m == 0) {
                                                            application
                                                                    .insertIntenetScheduleData(
                                                                            list.get(i).cId,
                                                                            list.get(i).cContent,
                                                                            list.get(i).cDate,
                                                                            list.get(i).cTime,
                                                                            list.get(i).cIsAlarm,
                                                                            list.get(i).cBeforTime,
                                                                            list.get(i).cDisplayAlarm,
                                                                            list.get(i).cPostpone,
                                                                            list.get(i).cImportant,
                                                                            list.get(i).cColorType,
                                                                            list.get(i).cIsEnd,
                                                                            str,
                                                                            list.get(i).cTags,
                                                                            list.get(i).cType,
                                                                            list.get(i).cTypeDesc,
                                                                            list.get(i).cTypeSpare,
                                                                            list.get(i).cRepeatId,
                                                                            list.get(i).cRepeatDate,
                                                                            str,
                                                                            0,
                                                                            list.get(i).cOpenState,
                                                                            list.get(i).cSchRepeatLink,
                                                                            ringdesc,
                                                                            ringcode,
                                                                            list.get(i).cRecommendName,
                                                                            list.get(i).schRead,
                                                                            aid,
                                                                            atype,
                                                                            list.get(i).webUrl,
                                                                            list.get(i).imgPath,
                                                                            1,
                                                                            0,
                                                                            list.get(i).cRecommendId,list.get(i).pIsEnd,
                                                                            list.get(i).remark,
                                                                            list.get(i).remark1,
                                                                            list.get(i).remark2,
                                                                            list.get(i).remark3,
                                                                            list.get(i).remark4,list.get(i).remark7,list.get(i).remark10,list.get(i).remark11,list.get(i).remark12);
                                                        } else {
                                                            application.updateScheduleData(
                                                                            list.get(i).cId,
                                                                            list.get(i).cContent,
                                                                            list.get(i).cDate,
                                                                            list.get(i).cTime,
                                                                            list.get(i).cIsAlarm,
                                                                            list.get(i).cBeforTime,
                                                                            list.get(i).cDisplayAlarm,
                                                                            list.get(i).cPostpone,
                                                                            list.get(i).cImportant,
                                                                            list.get(i).cColorType,
                                                                            list.get(i).cIsEnd,
                                                                            list.get(i).cTags,
                                                                            list.get(i).cType,
                                                                            list.get(i).cTypeDesc,
                                                                            list.get(i).cTypeSpare,
                                                                            list.get(i).cRepeatId,
                                                                            list.get(i).cRepeatDate,
                                                                            str,
                                                                            0,
                                                                            list.get(i).cOpenState,
                                                                            list.get(i).cSchRepeatLink,
                                                                            ringdesc,
                                                                            ringcode,
                                                                            list.get(i).cRecommendName,
                                                                            list.get(i).schRead,
                                                                            aid,
                                                                            list.get(i).aType,
                                                                            list.get(i).webUrl,
                                                                            list.get(i).imgPath,
                                                                            0,
                                                                            0,
                                                                            list.get(i).cRecommendId,list.get(i).pIsEnd, list.get(i).remark,
                                                                            list.get(i).remark1,
                                                                            list.get(i).remark2,
                                                                            list.get(i).remark3,
                                                                            list.get(i).remark4,list.get(i).remark7,list.get(i).remark10,list.get(i).remark11,list.get(i).remark12);
                                                        }
                                                    }
                                                }

                                                if (deleteID != null && deleteID.size() > 0) {
                                                    for (int i = 0; i < deleteID.size(); i++) {
                                                        application.deleteScheduleData(deleteID.get(i));
                                                        application.deleteSch(deleteID.get(i));
                                                    }
                                                }
                                                QueryAlarmData.writeAlarm(getApplicationContext());
                                                Intent intentappwidget = new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
                                                Bundle extras = new Bundle();
                                                intentappwidget.putExtras(extras);
                                                sendBroadcast(intentappwidget);
                                                sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE, ShareFile.INDEX, index + "");
                                                if (isOnRefresh) {
                                                    Intent intent = new Intent();
                                                    intent.setAction(Const.SHUAXINDATA);
                                                    intent.putExtra("data", "success");
                                                    if (list != null && list.size() > 0) {
                                                        intent.putExtra("index", index);
                                                        intent.putExtra("what", 2);
                                                    } else {
                                                        intent.putExtra("index", -10);
                                                        intent.putExtra("what", 2);
                                                    }
                                                    sendBroadcast(intent);
                                                }
                                            } else if (downLoadBean.status == 1) {
                                                sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE,
                                                        ShareFile.DOWNSCHTIME, downLoadBean.message.replace("T", " "));
                                                sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE, ShareFile.INDEX, index + "");
                                            } else {
                                                sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE, ShareFile.INDEX, index + "");
                                            }
                                        } catch (JsonSyntaxException e) {
                                            e.printStackTrace();
                                            sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE, ShareFile.INDEX, index + "");
                                        }
                                    }
                                }).start();

                            }
                        }
                    }, new Response.ErrorListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {
                    stopSelf();
                    if (isOnRefresh) {
                        Intent intent = new Intent(Const.SHUAXINDATA);
                        intent.putExtra("data", "success");
                        intent.putExtra("index", -10);
                        intent.putExtra("what", 2);
                        sendBroadcast(intent);
                    }
                }
            });
            request.setTag("downCalender");
            request.setRetryPolicy(new DefaultRetryPolicy(10000, 1, 1.0f));
            App.getHttpQueues().add(request);
        }

        downqqq();
        return super.onStartCommand(intent, flags, startId);
    }

    private void downqqq() {
        if (!sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.SJB, "").isEmpty()) {
            String[] sjbs = sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.SJB, "").split(",,");
            for (String uid: sjbs[1].replace("[","").replace("]","").split(",")) {
                path = URLConstants.数据下载同步 + "?cUid=" + uid.replace("[","").replace("]","") + "&beforDownTime=&time=";
                StringRequest request = new StringRequest(Method.GET, path,
                        new Response.Listener<String>() {

                            @Override
                            public void onResponse(final String result) {
                                if (!TextUtils.isEmpty(result)) {
                                    new Thread(new Runnable() {

                                        @Override
                                        public void run() {
                                            try {
                                                Gson gson = new Gson();
                                                DownLoadBackBean downLoadBean = gson.fromJson(result, DownLoadBackBean.class);
                                                List<ScheduBean> list = null;
                                                List<Integer> deleteID = null;
                                                if (downLoadBean.status == 0) {
                                                    sharedPrefUtil.putString(getApplication(), ShareFile.USERFILE, ShareFile.DOWNSCHTIME, downLoadBean.message.replace("T", " "));
                                                    List<DownLoadBean> beans = downLoadBean.maps;
                                                    for (int k = 0; k < beans.size(); k++) {
                                                        deleteID = beans.get(k).delete;
                                                        list = beans.get(k).tbCalendar;
                                                    }
                                                    if (list != null && list.size() > 0) {
                                                        for (int i = 0; i < list.size(); i++) {
                                                            String ringcode = "";
                                                            String ringdesc = "";
                                                            for (int j = 0; j < soundlist.size(); j++) {
                                                                String str = list.get(i).cAlarmSoundDesc.replace(".ogg", "");
                                                                if (str.equals(soundlist.get(j).get("value"))) {
                                                                    ringcode = soundlist.get(j).get("value");
                                                                    ringdesc = soundlist.get(j).get("name");
                                                                    break;
                                                                } else {
                                                                    ringcode = "g_88";
                                                                    ringdesc = "完成任务";
                                                                }
                                                            }
                                                            String str = list.get(i).cUpdateTime.toString().replace("T", " ");
                                                            int m = application.CheckCountSchData(list.get(i).cId);
                                                            int aid = list.get(i).attentionid;
                                                            int atype = list.get(i).aType;
                                                            if (m == 0) {
                                                                application.insertIntenetScheduleData(
                                                                        list.get(i).cId,
                                                                        list.get(i).cContent,
                                                                        list.get(i).cDate,
                                                                        list.get(i).cTime,
                                                                        list.get(i).cIsAlarm,
                                                                        list.get(i).cBeforTime,
                                                                        list.get(i).cDisplayAlarm,
                                                                        list.get(i).cPostpone,
                                                                        list.get(i).cImportant,
                                                                        list.get(i).cUid,
                                                                        list.get(i).cIsEnd,
                                                                        str,
                                                                        list.get(i).cTags,
                                                                        list.get(i).cType,
                                                                        list.get(i).cTypeDesc,
                                                                        list.get(i).cTypeSpare,
                                                                        list.get(i).cRepeatId,
                                                                        list.get(i).cRepeatDate,
                                                                        str,
                                                                        0,
                                                                        list.get(i).cOpenState,
                                                                        list.get(i).cSchRepeatLink,
                                                                        ringdesc,
                                                                        ringcode,
                                                                        list.get(i).cRecommendName,
                                                                        list.get(i).schRead,
                                                                        aid,
                                                                        atype,
                                                                        list.get(i).webUrl,
                                                                        list.get(i).imgPath,
                                                                        1,
                                                                        0,
                                                                        list.get(i).cRecommendId,list.get(i).pIsEnd,
                                                                        list.get(i).remark,
                                                                        list.get(i).remark1,
                                                                        list.get(i).remark2,
                                                                        list.get(i).remark3,
                                                                        list.get(i).remark4,list.get(i).remark7,list.get(i).remark10,list.get(i).remark11,list.get(i).remark12);
                                                            } else {
                                                                application.updateScheduleData(
                                                                        list.get(i).cId,
                                                                        list.get(i).cContent,
                                                                        list.get(i).cDate,
                                                                        list.get(i).cTime,
                                                                        list.get(i).cIsAlarm,
                                                                        list.get(i).cBeforTime,
                                                                        list.get(i).cDisplayAlarm,
                                                                        list.get(i).cPostpone,
                                                                        list.get(i).cImportant,
                                                                        list.get(i).cUid,
                                                                        list.get(i).cIsEnd,
                                                                        list.get(i).cTags,
                                                                        list.get(i).cType,
                                                                        list.get(i).cTypeDesc,
                                                                        list.get(i).cTypeSpare,
                                                                        list.get(i).cRepeatId,
                                                                        list.get(i).cRepeatDate,
                                                                        str,
                                                                        0,
                                                                        list.get(i).cOpenState,
                                                                        list.get(i).cSchRepeatLink,
                                                                        ringdesc,
                                                                        ringcode,
                                                                        list.get(i).cRecommendName,
                                                                        list.get(i).schRead,
                                                                        aid,
                                                                        list.get(i).aType,
                                                                        list.get(i).webUrl,
                                                                        list.get(i).imgPath,
                                                                        0,
                                                                        0,
                                                                        list.get(i).cRecommendId,list.get(i).pIsEnd, list.get(i).remark,
                                                                        list.get(i).remark1,
                                                                        list.get(i).remark2,
                                                                        list.get(i).remark3,
                                                                        list.get(i).remark4,list.get(i).remark7,list.get(i).remark10,list.get(i).remark11,list.get(i).remark12);
                                                            }
                                                        }
                                                    }

                                                    if (deleteID != null && deleteID.size() > 0) {
                                                        for (int i = 0; i < deleteID.size(); i++) {
                                                            application.deleteScheduleData(deleteID.get(i));
                                                            application.deleteSch(deleteID.get(i));
                                                        }
                                                    }
                                                }
                                            } catch (JsonSyntaxException e) {
                                                e.printStackTrace();
                                            }
                                        }
                                    }).start();

                                }
                            }
                        }, new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                    }
                });
                request.setTag("downCalender");
                request.setRetryPolicy(new DefaultRetryPolicy(10000, 1, 1.0f));
                App.getHttpQueues().add(request);
            }
        }
    }

    /**
     * 下载好友信息
     */

    public void DownFrend() {
        Intent pull = new Intent();
        pull.setAction("pullRecevier");
        getApplication().sendBroadcast(pull);
        Log.e("TAG", "下载好友信息");
        StringRequest request = new StringRequest(Method.POST, URLConstants.HOST + "/appFrends_findFrendsSay.do",
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String result) {
                        if (!TextUtils.isEmpty(result)) {
                            try {
                                Gson gson = new Gson();

                                FriendBackBean friendBackBean = gson.fromJson(result, FriendBackBean.class);
                                if (friendBackBean.status == 0) {

                                    List<FriendBean> friendBeanList = friendBackBean.list;
                                    if (friendBeanList != null) {

                                        for (FriendBean bean : friendBeanList) {
                                            App.getDBcApplication().insertFriendsList(bean);
                                        }

                                    }
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                        DownFrendCalender();
                    }

                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                DownFrendCalender();
            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<>();
                map.put("uId", UserId);// "52432"
                map.put("updateTime", sharedPrefUtil.getString(getApplicationContext(),
                        ShareFile.USERFILE, ShareFile.UPDATESETTIME, "2016-01-01"));//"2015-01-01 00:00:00"
                return map;
            }
        };
        request.setTag("DownFrend");
        request.setRetryPolicy(new DefaultRetryPolicy(10000, 1, 1.0f));
        App.getHttpQueues().add(request);
    }


    /**
     * 下载所有日程信息
     */
    public void DownFrendCalender() {
        Log.e("TAG", "下载所有日程信息_S");
        StringRequest request = new StringRequest(Method.POST, URLConstants.HOST + "/appFrends_downFrendsCalendar.do", new Response.Listener<String>() {
            @Override
            public void onResponse(String s) {
                if (!TextUtils.isEmpty(s)) {
                    try {
                        Gson gson = new Gson();

                        FriendDownBackBean findFrendsSayBean = gson.fromJson(s, FriendDownBackBean.class);
                        if (findFrendsSayBean.status == 0) {

                            sharedPrefUtil
                                    .putString(
                                            getApplication(),
                                            ShareFile.USERFILE,
                                            ShareFile.PERSONDOWNTIME,
                                            findFrendsSayBean.downTime.replace('T', ' '));

                            List<FriendDownAllScheduleBean> firendDownBeanList = findFrendsSayBean.list;
                            List<FriendDeleteScheduleBean> friendDeleteScheduleBeanList = findFrendsSayBean.delList;
                            if (firendDownBeanList != null) {
                                for (FriendDownAllScheduleBean bean : firendDownBeanList) {
                                    App.getDBcApplication().insertFriendSchedule(bean);
                                }
                            }
                            if (friendDeleteScheduleBeanList != null) {
                                for (FriendDeleteScheduleBean bean : friendDeleteScheduleBeanList) {
                                    App.getDBcApplication().deleteFriendSchedule(bean.dataId);
                                }
                            }

                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }


        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<String, String>();
                map.put("uId", UserId);
                map.put("updateTime", sharedPrefUtil.getString(getApplicationContext(), ShareFile.USERFILE, ShareFile.PERSONDOWNTIME, "2016-01-01"));
                return map;
            }
        };
        request.setTag("DownFrendCalender");
        request.setRetryPolicy(new DefaultRetryPolicy(5000, 1, 1.0f));
        App.getHttpQueues().add(request);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        App.getHttpQueues().cancelAll("downCalender");
        App.getHttpQueues().cancelAll("downNoteCalender");
        App.getHttpQueues().cancelAll("deleteurl");
        App.getHttpQueues().cancelAll("downNoteHongd");
        App.getHttpQueues().cancelAll("DownFrend");
        App.getHttpQueues().cancelAll("DownFrendCalender");
        App.getHttpQueues().cancelAll("deletecalenderurl");
        App.getHttpQueues().cancelAll("DownFrendCalender");
        App.getHttpQueues().cancelAll("downSixTaskCalender");
        App.getHttpQueues().cancelAll("updateFrendTaskIsDown");
        App.getHttpQueues().cancelAll("下行临时表数据");
        stopSelf();
    }

    private void deleteNoteUrl() {
        StringRequest request = new StringRequest(Method.POST, URLConstants.清单留言公开方公开发送url删除, new Response.Listener<String>() {
            @Override
            public void onResponse(String s) {
            }


        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<String, String>();
                map.put("uId", UserId);
                return map;
            }
        };
        request.setTag("deleteurl");
        request.setRetryPolicy(new DefaultRetryPolicy(3000, 1, 1.0f));
        App.getHttpQueues().add(request);
    }

    private void updateFrendTaskIsDown() {
        StringRequest request = new StringRequest(Method.POST, URLConstants.接收方任务收到通知, new Response.Listener<String>() {
            @Override
            public void onResponse(String s) {
                String ss = s;
            }


        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<String, String>();
                map.put("uid", UserId);
                map.put("downTime", dowmTime);
                return map;
            }
        };
        request.setTag("updateFrendTaskIsDown");
        request.setRetryPolicy(new DefaultRetryPolicy(3000, 1, 1.0f));
        App.getHttpQueues().add(request);
    }

    private void deleteCalenderNoteUrl() {
        StringRequest request = new StringRequest(Method.POST, URLConstants.删除临时日程清单, new Response.Listener<String>() {
            @Override
            public void onResponse(String s) {
            }


        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<String, String>();
                map.put("uid", UserId);
                return map;
            }
        };
        request.setTag("deletecalenderurl");
        request.setRetryPolicy(new DefaultRetryPolicy(3000, 1, 1.0f));
        App.getHttpQueues().add(request);
    }

    class ReHod {

        /**
         * delList : null
         * downTime : 2017-07-05T17:36:52
         * list : [{"changeTime":"2017-07-05T17:28:46","id":11,"remark":null,"remark1":null,"titleId":"20170705110515970647","type":0,"uid":255212}]
         * message : 成功
         * status : 0
         * tDelList : null
         */

        public Object delList;
        public String downTime;
        public String message;
        public int status;
        public Object tDelList;
        public List<ListBean> list;

        public Object getDelList() {
            return delList;
        }

        public void setDelList(Object delList) {
            this.delList = delList;
        }

        public String getDownTime() {
            return downTime;
        }

        public void setDownTime(String downTime) {
            this.downTime = downTime;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public Object getTDelList() {
            return tDelList;
        }

        public void setTDelList(Object tDelList) {
            this.tDelList = tDelList;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public class ListBean {
            /**
             * changeTime : 2017-07-05T17:28:46
             * id : 11
             * remark : null
             * remark1 : null
             * titleId : 20170705110515970647
             * type : 0
             * uid : 255212
             */

            public String changeTime;
            public int id;
            public Object remark;
            public Object remark1;
            public String titleId;
            public int type;
            public int uid;

            public String getChangeTime() {
                return changeTime;
            }

            public void setChangeTime(String changeTime) {
                this.changeTime = changeTime;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public Object getRemark() {
                return remark;
            }

            public void setRemark(Object remark) {
                this.remark = remark;
            }

            public Object getRemark1() {
                return remark1;
            }

            public void setRemark1(Object remark1) {
                this.remark1 = remark1;
            }

            public String getTitleId() {
                return titleId;
            }

            public void setTitleId(String titleId) {
                this.titleId = titleId;
            }

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }

            public int getUid() {
                return uid;
            }

            public void setUid(int uid) {
                this.uid = uid;
            }
        }
    }

    class DownNoteCalnderBean {


        /**
         * status : 0
         * downTime : 2017-07-05T10:24:30
         * message : 成功
         * list : [{"remark":null,"content":"任务的元素","titleImg":"","id":43,"titleId":"20170704165758559924","tuId":255191,"changTime":"2017-07-04T19:27:43","uid":52432,"name":"EdwardMT"}]
         * tDelList : null
         * delList : null
         */

        public int status;
        public String downTime;
        public String message;
        public Object tDelList;
        public Object delList;
        public List<ListBean> list;

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public String getDownTime() {
            return downTime;
        }

        public void setDownTime(String downTime) {
            this.downTime = downTime;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public Object getTDelList() {
            return tDelList;
        }

        public void setTDelList(Object tDelList) {
            this.tDelList = tDelList;
        }

        public Object getDelList() {
            return delList;
        }

        public void setDelList(Object delList) {
            this.delList = delList;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public class ListBean {
            /**
             * remark : null
             * content : 任务的元素
             * titleImg :
             * id : 43
             * titleId : 20170704165758559924
             * tuId : 255191
             * changTime : 2017-07-04T19:27:43
             * uid : 52432
             * name : EdwardMT
             */

            public String remark;
            public String content;
            public String titleImg;
            public int id;
            public String titleId;
            public int tuId;
            public String changTime;
            public int uid;
            public String name;

            public String getRemark() {
                return remark;
            }

            public void setRemark(String remark) {
                this.remark = remark;
            }

            public String getContent() {
                return content;
            }

            public void setContent(String content) {
                this.content = content;
            }

            public String getTitleImg() {
                return titleImg;
            }

            public void setTitleImg(String titleImg) {
                this.titleImg = titleImg;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getTitleId() {
                return titleId;
            }

            public void setTitleId(String titleId) {
                this.titleId = titleId;
            }

            public int getTuId() {
                return tuId;
            }

            public void setTuId(int tuId) {
                this.tuId = tuId;
            }

            public String getChangTime() {
                return changTime;
            }

            public void setChangTime(String changTime) {
                this.changTime = changTime;
            }

            public int getUid() {
                return uid;
            }

            public void setUid(int uid) {
                this.uid = uid;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }
        }
    }

    class findCalendarTj{

        /**
         * downTime : 2018-06-12T15:51:21
         * list : [{"createTime":"2018-06-04T10:41:55","id":7,"imgUrl":null,"name":"世界杯","orderId":1,"remark":null,"type":"0","uid":1448019},{"createTime":"2018-06-08T10:55:17","id":8,"imgUrl":null,"name":"重要日","orderId":0,"remark":null,"type":"0","uid":1448715}]
         * list2 : null
         * listOpdata : null
         * message : 成功
         * page : null
         * status : 0
         */

        public String downTime;
        public Object list2;
        public Object listOpdata;
        public String message;
        public Object page;
        public int status;
        public List<ListBean> list;

        public String getDownTime() {
            return downTime;
        }

        public void setDownTime(String downTime) {
            this.downTime = downTime;
        }

        public Object getList2() {
            return list2;
        }

        public void setList2(Object list2) {
            this.list2 = list2;
        }

        public Object getListOpdata() {
            return listOpdata;
        }

        public void setListOpdata(Object listOpdata) {
            this.listOpdata = listOpdata;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public Object getPage() {
            return page;
        }

        public void setPage(Object page) {
            this.page = page;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public class ListBean {
            /**
             * createTime : 2018-06-04T10:41:55
             * id : 7
             * imgUrl : null
             * name : 世界杯
             * orderId : 1
             * remark : null
             * type : 0
             * uid : 1448019
             */

            public String createTime;
            public int id;
            public Object imgUrl;
            public String name;
            public int orderId;
            public Object remark;
            public String type;
            public int uid;

            public String getCreateTime() {
                return createTime;
            }

            public void setCreateTime(String createTime) {
                this.createTime = createTime;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public Object getImgUrl() {
                return imgUrl;
            }

            public void setImgUrl(Object imgUrl) {
                this.imgUrl = imgUrl;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getOrderId() {
                return orderId;
            }

            public void setOrderId(int orderId) {
                this.orderId = orderId;
            }

            public Object getRemark() {
                return remark;
            }

            public void setRemark(Object remark) {
                this.remark = remark;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public int getUid() {
                return uid;
            }

            public void setUid(int uid) {
                this.uid = uid;
            }
        }
    }
}
